package com.example.win.android_banduyujia.peopleactivity.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.win.android_banduyujia.R;
import com.example.win.android_banduyujia.entity.Bean;

import java.util.List;

/**
 * Created by Win on 2015/8/31.
 */
public class NotificationAdapter extends RecyclerView.Adapter {

    private static final int TYPE_TV = 0x000;
    private static final int TYPE_IV = 0x0001;

    private  String[]  dabaset;
    private  Context   context;
    private  List<Bean>  beans;

    public NotificationAdapter(String[]  dabaset){
           this.dabaset = dabaset;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public int getItemViewType(int position) {
        if (position % 3 == 0) {
            return TYPE_IV;
        } else if (position % 3 == 1) {
            return TYPE_IV;
        } else {
            return  TYPE_TV;
        }
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view = View.inflate(viewGroup.getContext(), R.layout.view_notification_list_item, null);

        return new OrderListViewHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int i) {
        /*switch (getItemViewType(i)){
            case Bean.X_TYPE:
                 OrderListViewHolder  holder1 = (OrderListViewHolder) holder;
                 holder1.mTvt.setText(beans.get(i).getTextview());
                break;

        }*/
    }

    @Override
    public int getItemCount() {
        return dabaset.length;
    }

    private class OrderListViewHolder extends RecyclerView.ViewHolder  {

        private Context   mContext;
        private RelativeLayout  RelaLayout;
        private TextView      mTvt;

        public OrderListViewHolder(View itemview) {
            super(itemview);
            //itemview.setOnClickListener(this);
                RelaLayout = (RelativeLayout) itemview.findViewById(R.id.layout_linear_order_list);
                mTvt = (TextView)itemview.findViewById(R.id.layout_text_view_status_see);
        }
    }
}
